'use strict';
const fs = require('fs');
const https = require('https');
const options = {
  key: fs.readFileSync('server.pem.key'),
  cert: fs.readFileSync('server.pem.cer')
}

const express = require('express')
const bodyParser = require('body-parser');

const app = express();
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({
    extended: false
}));

app.get('/hello',function(req,res){
	res.end('https is ok');
})

https.createServer(options, app).listen(443,(err)=>{
	if(err){
		console.log(err)
	}else {
		console.log('server start at 443');
	}
});
